{extend name="base" /}
{block name="body"}
<form action="{:request()->url()}" class="layui-form layui-form-pane" method="post" onsubmit="return false;">
    <div class="layui-form-item">
        <label class="layui-form-label">上级菜单</label>
        <div class="layui-input-block">
            <select name="pid" lay-search>
                <option value="0">主菜单</option>
                {foreach name="authRule" item="v" empty="$empty"}
                <option value="{$v.id}" {if condition="isset($data) and $data.pid eq $v.id"}selected="selected"{/if}{if input('pid')==$v.id}selected="selected"{/if}>{neq name="v.level" value="1"}|{php}for($i=1;$i<$v['level'];$i++){echo ' ---';}{/php}{/neq} {$v.name}</option>
                 {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" value="{$data.name}" autocomplete="off" placeholder="请输入名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">控制器</label>
        <div class="layui-input-block">
            <input type="text" name="url" value="{$data.url|default=''}" autocomplete="off" placeholder="admin/index/index" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图标</label>
        <div class="layui-input-block">
            <input type="text" name="icon" value="{$data.icon|default=''}" autocomplete="off" placeholder="layui-icon" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">菜单类型</label>
        <div class="layui-input-block">
            <input type="radio" name="openType" value="_iframe" title="_iframe" {if empty($data) or isset($data) and $data.openType eq '_iframe'}checked="checked"{/if}>
            <input type="radio" name="openType" value="_blank" title="_blank" {if isset($data) and $data.openType eq '_blank'}checked="checked"{/if}>
            <input type="radio" name="openType" value="_layer" title="_layer" {if isset($data) and $data.openType eq '_layer'}checked="checked"{/if}>
        </div>
    </div>
    <div class="layui-form-item" pane>
        <label class="layui-form-label">菜单显示？</label>
        <div class="layui-input-block">
            <input type="radio" name="ismenu" value="1" title="是" {if empty($data) or isset($data) and $data.ismenu eq '1'}checked="checked"{/if}>
            <input type="radio" name="ismenu" value="0" title="否" {if isset($data) and $data.ismenu eq '0'}checked="checked"{/if}>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="weigh" value="{$data.weigh|default='0'}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="id" value="{$data.id|default=''}">
                    <button class="layui-btn layui-btn-sm" lay-filter="save" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-sm layui-btn-danger close">关闭</button>
        </div>
    </div>
</form>
{/block}